package com.itsxb.autoconfigure;

import com.itsxb.configure.SaTokenConfig;
import com.itsxb.configure.SatokenIntercepter;
import com.itsxb.configure.StpInterfaceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

@Configuration
public class SaTokenConfigure {
    @Bean
    public SaTokenConfig initSaTokenConfigure(){
        return new SaTokenConfig();
    }

    @Bean
    public StpInterfaceImpl getStpInterfaceImpl(RedisTemplate redisTemplate){
        return new StpInterfaceImpl(redisTemplate);
    }
    //将在Springboot启动之后 这个拦截器生效
    @Bean
    public SatokenIntercepter getSatokenIntercepter(){
        return new SatokenIntercepter();
    }
}